Repository navigation
fix(font): shape_fallback 增加 fallback chain 遍历——修复 C3 搜索框中文豆腐块 - #144
Merged
Merged
Conversation
shape_fallback 在主字体缺字形时直接用 glyph_id=0(.notdef = 豆腐块), 不尝试 fallback_chain 中的其他字体。修正:主字体查不到 glyph 时依次 尝试 fallback_chain 中的每个字体(NotoSansCJK/WQY 等已加载的 CJK 字体), 仅在全部字体都无该字形时才回退 .notdef。 FontLoader 已有 set_fallback_chain/fallback_chain() 基础设施(system.rs 加载 CJK 字体后注入),但 shape_fallback 未消费。本修复连接两者。 验证:render-foundation lib 706P/0F。
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: 35368088-ef1c-46d5-87f8-fa8c8ede6706) |
leizongmin
added a commit
that referenced
this pull request
Oct 12, 2026
…hub(imported-tests.txt 双保留) 同步 main(#140–#144:R5073–R5079 layout/css 修复、webmessaging M2/M3、CORS range safelist、shape_fallback 中文字体 fallback chain)。冲突仅 tests/wpt-runner/ imported-tests.txt:双方新增条目均保留(main 4 条 + 本分支 css-fonts/system-ui-bold-zw-001 1 条),无产品代码手工改动。 Co-Authored-By: Claude Code <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Low Risk
Narrow change to the fontdue shaping fallback path; improves glyph resolution without touching auth, layout, or network code.
Overview
Fixes CJK “tofu” (
.notdef/glyph_id=0) in the fontdue per-character fallback path when the primary face lacks a glyph—e.g. Chinese in the C3 search box.When
shape_fallbackruns (after rustybuzz is unavailable), a missing glyph on the default font no longer immediately uses placeholder metrics. It walksFontLoader::fallback_chain()(CJK faces injected viaset_fallback_chaininsystem.rs) and uses the first fallback font that has real glyph metrics; only if none match does it keep(0, font_size * 0.6).Reviewed by Cursor Bugbot for commit 7ae4e71. Bugbot is set up for automated code reviews on this repo. Configure here.